package web;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.ui.ModelMap;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

import dao.RestaurantDAO;

import beans.Restaurant;

public class TopController extends MultiActionController{
	
	private RestaurantDAO restaurantDAO;

	public void setRestaurantDAO(RestaurantDAO restaurantDAO) {
		this.restaurantDAO = restaurantDAO;
	}

	public ModelAndView top(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
			ModelMap modelMap = new ModelMap();
			List<Restaurant> list = restaurantDAO.DisplayTop();
			modelMap.addAttribute("topList", list);
			return new ModelAndView("top", modelMap);
			}
	
}

